#pragma once
#include "listeners.h"
 
class CFloor
{
public:
	CFloor(size_t floorNum);
	~CFloor(void);

	void ElevatorArrived();
	void ElevatorLeft();

	void RegisterListeners(ILoadPassengersListener* loadPassengerslistener, ICallRequestListener* callRequestListener);
	void AddIncomingPassengers(const std::vector<size_t>& passengerTargets);
	void WaitForElevator() { ++m_waitCount; };

	size_t GetNum() const { return m_floorNum; };
	const PassengerCollection& GetIncomingPassengers() const { return m_incomingPassengers; };
	size_t GetStepsWaited() const { return m_waitCount; };
private:
	size_t m_floorNum;
	PassengerCollection m_incomingPassengers;
	size_t m_waitCount;

	ILoadPassengersListener *m_elevatorArrivedListener;
	ICallRequestListener *m_callRequestlistener;
};
